//
// UParticleSystemInstance.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------
package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.CVector;

public class UParticleSystemInstance extends UInstance {
  private long swigCPtr;

  public UParticleSystemInstance(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.UParticleSystemInstance_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(UParticleSystemInstance obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_UParticleSystemInstance(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public boolean isSystemPresent() {
    return nel3dJNI.UParticleSystemInstance_isSystemPresent(swigCPtr, this);
  }

  public boolean getSystemBBox(SWIGTYPE_p_NLMISC__CAABBox bbox) {
    return nel3dJNI.UParticleSystemInstance_getSystemBBox(swigCPtr, this, SWIGTYPE_p_NLMISC__CAABBox.getCPtr(bbox));
  }

  public void setUserColor(CRGBA userColor) {
    nel3dJNI.UParticleSystemInstance_setUserColor(swigCPtr, this, CRGBA.getCPtr(userColor), userColor);
  }

  public CRGBA getUserColor() {
    return new CRGBA(nel3dJNI.UParticleSystemInstance_getUserColor(swigCPtr, this), true);
  }

  public void setUserParam(long index, float value) {
    nel3dJNI.UParticleSystemInstance_setUserParam(swigCPtr, this, index, value);
  }

  public static void setGlobalUserParamValue(String name, float value) {
    nel3dJNI.UParticleSystemInstance_setGlobalUserParamValue(name, value);
  }

  public static float getGlobalUserParamValue(String name) {
    return nel3dJNI.UParticleSystemInstance_getGlobalUserParamValue(name);
  }

  public static void setGlobalVectorValue(String name, CVector v) {
    nel3dJNI.UParticleSystemInstance_setGlobalVectorValue(name, CVector.getCPtr(v), v);
  }

  public static CVector getGlobalVectorValue(String name) {
    return new CVector(nel3dJNI.UParticleSystemInstance_getGlobalVectorValue(name), true);
  }

  public float getUserParam(long index) {
    return nel3dJNI.UParticleSystemInstance_getUserParam(swigCPtr, this, index);
  }

  public void bypassGlobalUserParamValue(long userParamIndex, boolean byPass) {
    nel3dJNI.UParticleSystemInstance_bypassGlobalUserParamValue__SWIG_0(swigCPtr, this, userParamIndex, byPass);
  }

  public void bypassGlobalUserParamValue(long userParamIndex) {
    nel3dJNI.UParticleSystemInstance_bypassGlobalUserParamValue__SWIG_1(swigCPtr, this, userParamIndex);
  }

  public boolean isGlobalUserParamValueBypassed(long userParamIndex) {
    return nel3dJNI.UParticleSystemInstance_isGlobalUserParamValueBypassed(swigCPtr, this, userParamIndex);
  }

  public boolean emit(long id, long quantity) {
    return nel3dJNI.UParticleSystemInstance_emit__SWIG_0(swigCPtr, this, id, quantity);
  }

  public boolean emit(long id) {
    return nel3dJNI.UParticleSystemInstance_emit__SWIG_1(swigCPtr, this, id);
  }

  public boolean removeByID(long id) {
    return nel3dJNI.UParticleSystemInstance_removeByID(swigCPtr, this, id);
  }

  public long getNumID() {
    return nel3dJNI.UParticleSystemInstance_getNumID(swigCPtr, this);
  }

  public long getID(long index) {
    return nel3dJNI.UParticleSystemInstance_getID(swigCPtr, this, index);
  }

  public boolean getIDs(Vector_uint16 dest) {
    return nel3dJNI.UParticleSystemInstance_getIDs(swigCPtr, this, Vector_uint16.getCPtr(dest), dest);
  }

  public boolean setActive(long id, boolean active) {
    return nel3dJNI.UParticleSystemInstance_setActive(swigCPtr, this, id, active);
  }

  public void activateEmitters(boolean active) {
    nel3dJNI.UParticleSystemInstance_activateEmitters(swigCPtr, this, active);
  }

  public boolean hasActiveEmitters() {
    return nel3dJNI.UParticleSystemInstance_hasActiveEmitters(swigCPtr, this);
  }

  public boolean hasParticles() {
    return nel3dJNI.UParticleSystemInstance_hasParticles(swigCPtr, this);
  }

  public boolean hasEmmiters() {
    return nel3dJNI.UParticleSystemInstance_hasEmmiters(swigCPtr, this);
  }

  public boolean isShared() {
    return nel3dJNI.UParticleSystemInstance_isShared(swigCPtr, this);
  }

  public boolean isValid() {
    return nel3dJNI.UParticleSystemInstance_isValid(swigCPtr, this);
  }

  public void setUserMatrix(SWIGTYPE_p_NLMISC__CMatrix userMat) {
    nel3dJNI.UParticleSystemInstance_setUserMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(userMat));
  }

  public void forceSetUserMatrix(SWIGTYPE_p_NLMISC__CMatrix userMat) {
    nel3dJNI.UParticleSystemInstance_forceSetUserMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(userMat));
  }

  public void forceInstanciate() {
    nel3dJNI.UParticleSystemInstance_forceInstanciate(swigCPtr, this);
  }

  public void setZBias(float value) {
    nel3dJNI.UParticleSystemInstance_setZBias(swigCPtr, this, value);
  }

  public static void forceDisplayBBox(boolean on) {
    nel3dJNI.UParticleSystemInstance_forceDisplayBBox(on);
  }

  public void cast(UInstance object) {
    nel3dJNI.UParticleSystemInstance_cast(swigCPtr, this, UInstance.getCPtr(object), object);
  }

  public void stopSound() {
    nel3dJNI.UParticleSystemInstance_stopSound(swigCPtr, this);
  }

  public void reactivateSound() {
    nel3dJNI.UParticleSystemInstance_reactivateSound(swigCPtr, this);
  }

  public UParticleSystemInstance() {
    this(nel3dJNI.new_UParticleSystemInstance__SWIG_0(), true);
  }

  public UParticleSystemInstance(CParticleSystemModel object) {
    this(nel3dJNI.new_UParticleSystemInstance__SWIG_1(CParticleSystemModel.getCPtr(object), object), true);
  }

  public void attach(CParticleSystemModel object) {
    nel3dJNI.UParticleSystemInstance_attach(swigCPtr, this, CParticleSystemModel.getCPtr(object), object);
  }

  public void detach() {
    nel3dJNI.UParticleSystemInstance_detach(swigCPtr, this);
  }

  public boolean empty() {
    return nel3dJNI.UParticleSystemInstance_empty(swigCPtr, this);
  }
  /**
   * @todo check
   *//*
  public CTransform getObjectPtr() {
    long cPtr = nel3dJNI.UParticleSystemInstance_getObjectPtr(swigCPtr, this);
    return (cPtr == 0) ? null : new CParticleSystemModel(cPtr, false);
  }*/

}
